home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / osi / isode / vmsisode / vmsisode80_tar.Z / vmsisode80_tar / sockit / gccinclude / stat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  2.2 KB  |  72 lines

  1. /*
  2.  *    VAX-11 "C" runtime compatible stat definition
  3.  */
  4.  
  5. #ifndef    _STAT_
  6. #define    _STAT_
  7.  
  8. /*
  9.  *    Because of alignment differences between VAX-11 "C" and GNU "C"
  10.  *    we can't normally access any field AFTER st_gid.  To fix this
  11.  *    the macro stat_alignment_fix(statp) makes fields AFTER st_gid
  12.  *    work right.  stat_alignment_fix2(statp) allows st_fab_mrs to be
  13.  *    accessed.
  14.  *
  15.  *    VMS/GCC defines the CPP variable "PCC_ALIGNMENT" if UNIX PCC
  16.  *    style alignment is in effect.  Otherwise, VAX-11 "C" style
  17.  *    alignment is in effect.
  18.  */
  19. #ifdef    PCC_ALIGNMENT
  20. #define    stat_alignment_fix(statp) \
  21.     ((struct stat *)((char *)statp - sizeof(short)))
  22.  
  23. #define    stat_alignment_fix1(statp) \
  24.     ((struct stat *)((char *)statp - sizeof(short) - sizeof(char)))
  25. #endif    PCC_ALIGNMENT
  26.  
  27. /*
  28.  *    If <sys/types> has not been included we need to define the following:
  29.  */
  30. #ifndef    _TYPES_
  31. typedef unsigned off_t;
  32. typedef unsigned short ino_t;
  33. typedef char *dev_t;
  34. #endif    _TYPES_
  35.  
  36. struct  stat
  37. {
  38.         dev_t   st_dev;
  39.         ino_t   st_ino[3];
  40.         unsigned short st_mode;
  41.         int    st_nlink;
  42.         unsigned st_uid;
  43.         unsigned short st_gid;    /* <---- The big screw...  VAX-11 "C" doesn't
  44.                     do alignment so everything following
  45.                     this is wrong! */
  46.         dev_t    st_rdev;
  47.         off_t   st_size;
  48.         unsigned st_atime;
  49.         unsigned st_mtime;
  50.         unsigned st_ctime;
  51.     char    st_fab_rfm;
  52.     char    st_fab_rat;
  53.     char    st_fab_fsz;    /* <---- Another screw */
  54.     unsigned st_fab_mrs;
  55. };
  56.  
  57. #define S_IFMT   0170000         /* type of file */
  58. #define          S_IFDIR 0040000 /* directory */
  59. #define          S_IFCHR 0020000 /* character special */
  60. #define          S_IFBLK 0060000 /* block special */
  61. #define          S_IFREG 0100000 /* regular */
  62. #define          S_IFMPC 0030000 /* multiplexed char special */
  63. #define          S_IFMPB 0070000 /* multiplexed block special */
  64. #define S_ISUID  0004000         /* set user id on execution */
  65. #define S_ISGID  0002000         /* set group id on execution */
  66. #define S_ISVTX  0001000         /* save swapped text even after use */
  67. #define S_IREAD  0000400         /* read permission, owner */
  68. #define S_IWRITE 0000200         /* write permission, owner */
  69. #define S_IEXEC  0000100         /* execute/search permission, owner */
  70.  
  71. #endif    _STAT_
  72.